7.Spring Boot集成常用配置参数 您所在的位置:网站首页 spring springmvc spring boot区别 7.Spring Boot集成常用配置参数

7.Spring Boot集成常用配置参数

2023-06-12 20:49| 来源: 网络整理| 查看: 265

目录

1. Spring Boot基本介绍及Eclipse插件安装(STS)

2. Spring Boot基本使用(Thymeleaf模板、国际化)

3. Spring Boot使用Thymeleaf模板引擎

4. Thymeleaf标签详细

5. Spring Boot自动配置

6. Spring Boot配置文件(yml、properties)

7. Spring Boot集成常用配置参数

8. Spring Boot常用注解及JPA注解

9. Spring Boot事务

10. Spring Boot热部署

11. Spring Boot中使用JSP

12. Spirng Boot自定义错误页面

13. Spring Boot防止表单重复提交实现方式

14. Spring Boot监听器、过滤器、拦截器

15. Spring Boot单元测试(Service、Mock、Feign、Http Rest API)

16. Spring Boot多线程基本使用

17. Spring Boot加载指定YML文件

Spring Boot集成常用配置参数 目录Spring Boot集成常用配置参数spring.mvcspring.messagesspring.mobilespring.viewspring.resourcesspring.servlet.multipartspring.freemarkerspring.velocityspring.thymeleafspring.mustachespring.groovy.templatespring.httpspring.jacksonspring.jersey

Spring Boot集成常用配置参数 spring.mvc spring.mvc前缀配置描述async.request-timeout设定async请求的超时时间,以毫秒为单位,如果没有设置的话,以具体实现的超时时间为准,比如tomcat的servlet3的话是10秒date-format设定日期的格式,比如dd/MM/yyyyfavicon.enabled是否支持favicon.ico,默认为: trueignore-default-model-on-redirect在重定向时是否忽略默认model的内容,默认为truelocale指定使用的Localemessage-codes-resolver-format指定message codes的格式化策略(PREFIX_ERROR_CODE,POSTFIX_ERROR_CODE)view.prefix指定mvc视图的前缀view.suffix指定mvc视图的后缀 spring.messages spring.messages前缀配置描述basename指定message的basename,多个以逗号分隔,如果不加包名的话,默认从classpath路径开始,默认: messagescache-seconds设定加载的资源文件缓存失效时间,-1的话为永不过期,默认为-1encoding设定Message bundles的编码,默认: UTF-8 spring.mobile spring.mobile前缀配置描述devicedelegatingviewresolver.enable-fallback是否支持fallback的解决方案,默认falsedevicedelegatingviewresolver.enabled是否开始device view resolver,默认为: falsedevicedelegatingviewresolver.mobile-prefix设定mobile端视图的前缀,默认为:mobile/devicedelegatingviewresolver.mobile-suffix设定mobile视图的后缀devicedelegatingviewresolver.normal-prefix设定普通设备的视图前缀devicedelegatingviewresolver.normal-suffix设定普通设备视图的后缀devicedelegatingviewresolver.tablet-prefix设定平板设备视图前缀,默认:tablet/devicedelegatingviewresolver.tablet-suffix设定平板设备视图后缀sitepreference.enabled是否启用SitePreferenceHandler,默认为: true spring.view spring.view前缀配置描述prefix设定mvc视图的前缀suffix设定mvc视图的后缀 spring.resources spring.mappings 前缀配置描述add-mappings是否开启默认的资源处理,默认为truecache-period设定资源的缓存时效,以秒为单位chain.cache是否开启缓存,默认为: truechain.enabled是否开启资源 handling chain,默认为falsechain.html-application-cache是否开启h5应用的cache manifest重写,默认为: falsechain.strategy.content.enabled是否开启内容版本策略,默认为falsechain.strategy.content.paths指定要应用的版本的路径,多个以逗号分隔,默认为:[/**]chain.strategy.fixed.enabled是否开启固定的版本策略,默认为falsechain.strategy.fixed.paths指定要应用版本策略的路径,多个以逗号分隔chain.strategy.fixed.version指定版本策略使用的版本号static-locations指定静态资源路径。默认为classpath:[/META-INF/resources/,/resources/, /static/, /public/]以及context:/ spring.servlet.multipart spring.servlet.multipart前缀配置描述enabled是否开启文件上传支持,默认为truefile-size-threshold设定文件写入磁盘的阈值,单位为MB或KB,默认为0location指定文件上传路径max-file-size指定文件大小最大值,默认1MBmax-request-size指定每次请求的最大值,默认为10MB spring.freemarker spring.freemarker前缀配置描述allow-request-override指定HttpServletRequest的属性是否可以覆盖controller的model的同名项allow-session-override指定HttpSession的属性是否可以覆盖controller的model的同名项cache是否开启template cachingcharset设定Template的编码check-template-location是否检查templates路径是否存在content-type设定Content-Typeenabled是否允许mvc使用freemarkerexpose-request-attributes设定所有request的属性在merge到模板的时候,是否要都添加到model中expose-session-attributes设定所有HttpSession的属性在merge到模板的时候,是否要都添加到model中expose-spring-macro-helpers设定是否以springMacroRequestContext的形式暴露RequestContext给Spring’s macro library使用prefer-file-system-access是否优先从文件系统加载template,以支持热加载,默认为trueprefix设定freemarker模板的前缀request-context-attribute指定RequestContext属性的名settings设定FreeMarker keyssuffix设定模板的后缀template-loader-path设定模板的加载路径,多个以逗号分隔,默认: [“classpath:/templates/”]view-names指定使用模板的视图列表 spring.velocity spring.velocity前缀配置描述allow-request-override指定HttpServletRequest的属性是否可以覆盖controller的model的同名项allow-session-override指定HttpSession的属性是否可以覆盖controller的model的同名项cache是否开启模板缓存charset设定模板编码check-template-location是否检查模板路径是否存在content-type设定ContentType的值date-tool-attribute设定暴露给velocity上下文使用的DateTool的名enabled设定是否允许mvc使用velocityexpose-request-attributes是否在merge模板的时候,将request属性都添加到model中expose-session-attributes是否在merge模板的时候,将HttpSession属性都添加到model中expose-spring-macro-helpers设定是否以springMacroRequestContext的名来暴露RequestContext给Spring’s macro类库使用number-tool-attribute设定暴露给velocity上下文的NumberTool的名prefer-file-system-access是否优先从文件系统加载模板以支持热加载,默认为trueprefix设定velocity模板的前缀properties设置velocity的额外属性request-context-attribute设定RequestContext attribute的名resource-loader-path设定模板路径,默认为: classpath:/templates/suffix设定velocity模板的后缀toolbox-config-location设定Velocity Toolbox配置文件的路径,比如 /WEB-INF/toolbox.xmlview-names设定需要解析的视图名称 spring.thymeleaf spring.thymeleaf前缀配置描述cache是否开启模板缓存,默认truecheck-template-location是否检查模板路径是否存在,默认truecontent-type指定Content-Type,默认为: text/htmlenabled是否允许MVC使用Thymeleaf,默认为: trueencoding指定模板的编码,默认为: UTF-8excluded-view-names指定不使用模板的视图名称,多个以逗号分隔mode指定模板的模式,具体查看StandardTemplateModeHandlers,默认为: HTML5prefix指定模板的前缀,默认为:classpath:/templates/suffix指定模板的后缀,默认为:.htmltemplate-resolver-order指定模板的解析顺序,默认为第一个view-names指定使用模板的视图名,多个以逗号分隔 spring.mustache spring.mustache前缀配置描述cache是否Enable template cachingcharset指定Template的编码check-template-location是否检查默认的路径是否存在content-type指定Content-Typeenabled是否开启mustcache的模板支持prefix指定模板的前缀,默认: classpath:/templates/suffix指定模板的后缀,默认: .htmlview-names指定要使用模板的视图名 spring.groovy.template spring.groovy.template前缀配置描述allow-request-override指定HttpServletRequest的属性是否可以覆盖controller的model的同名项allow-session-override指定HttpSession的属性是否可以覆盖controller的model的同名项cache是否开启模板缓存charset指定Template编码check-template-location是否检查模板的路径是否存在configuration.auto-escape是否在渲染模板时自动排查model的变量,默认为: falseconfiguration.auto-indent是否在渲染模板时自动缩进,默认为falseconfiguration.auto-indent-string如果自动缩进启用的话,是使用SPACES还是TAB,默认为: SPACESconfiguration.auto-new-line渲染模板时是否要输出换行,默认为falseconfiguration.base-template-class指定template base classconfiguration.cache-templates是否要缓存模板,默认为trueconfiguration.declaration-encoding在写入declaration header时使用的编码configuration.expand-empty-elementsconfiguration.locale指定template localeconfiguration.new-line-string当启用自动换行时,换行的输出,默认为系统的line.separator属性的值configuration.resource-loader-path指定groovy的模板路径,默认为classpath:/templates/configuration.use-double-quotes指定属性要使用双引号还是单引号,默认为falsecontent-type指定Content-Typetemplate.enabled是否开启groovy模板的支持expose-request-attributes设定所有request的属性在merge到模板的时候,是否要都添加到model中expose-session-attributes设定所有request的属性在merge到模板的时候,是否要都添加到model中expose-spring-macro-helpers设定是否以springMacroRequestContext的形式暴露RequestContext给Spring’s macro library使用prefix指定模板的前缀suffix指定模板的后缀request-context-attribute指定RequestContext属性的名resource-loader-path指定模板的路径,默认为: classpath:/templates/view-names指定要使用模板的视图名称 spring.http spring.http前缀配置描述converters.preferred-json-mapper是否优先使用JSON mapper来转换encoding.charset指定http请求和相应的Charset,默认: UTF-8encoding.enabled是否开启http的编码支持,默认为trueencoding.force是否强制对http请求和响应进行编码,默认为true spring.jackson spring.jackson前缀配置描述date-format指定日期格式,比如yyyy-MM-dd HH:mm:ss,或者具体的格式化类的全限定名deserialization是否开启Jackson的反序列化generator是否开启json的generatorsjoda-date-time-format指定Joda date/time的格式,比如yyyy-MM-dd HH:mm:ss). 如果没有配置的话,dateformat会作为backuplocale指定json使用的Localemapper是否开启Jackson通用的特性parser是否开启jackson的parser特性property-naming-strategy指定PropertyNamingStrategy 。(CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES)或者指定PropertyNamingStrategy子类的全限定类名serialization是否开启jackson的序列化serialization-inclusion指定序列化时属性的inclusion方式,具体查看JsonInclude.Include枚举time-zone指定日期格式化时区,比如America/Los_Angeles或者GMT+10 spring.jersey spring.jersey前缀配置描述filter.order指定Jersey filter的order,默认为: 0init指定传递给Jersey的初始化参数type指定Jersey的集成类型,可以是servlet或者filter


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有